setup.js ➔ ???   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 10
rs 10
c 0
b 0
f 0
1
'use strict'
2
3
import mongoose from 'mongoose'
4
import chai from 'chai'
5
import chaiHttp from 'chai-http'
6
import dirtyChai from 'dirty-chai'
7
import { before, after } from 'mocha'
8
9
chai.use(chaiHttp)
10
chai.use(dirtyChai)
11
12
// prepares a clean bank
13
before(() => {
14
  const options = {
15
    useNewUrlParser: true
16
  }
17
  mongoose.connect('mongodb://localhost/devise', options, (err) => {
18
    if (err) {
19
      throw err
20
    }
21
  })
22
})
23
24
after(() => {
25
  mongoose.connection.dropDatabase()
26
})
27